import torch 
import scipy.io as scio
import numpy as np 
from model import CNN

if __name__ == "__main__":
    X = scio.loadmat("6.28_train" + "/traindata.mat")
    torch_X = torch.tensor(X["data2save_temp"], dtype=torch.float32)
    time_step, channel_num, batch = torch_X.shape
    X = torch_X.view(batch, time_step, channel_num)

    Y = scio.loadmat("./6.28_train/label.mat")
    Y = Y["train_label"]
    Y = torch.tensor(Y, dtype=torch.long)

    # torch.save(X, "./src_data_0628.pkl")
    # torch.save(Y, "./tgt_data_0628.pkl")

    print(X.shape)
    print(Y.shape)
    # print(X[0])

    # cnn_layer = CNN()
    # x = cnn_layer(X[:5])
    # print(x.shape)

    # X = scio.loadmat("test_data" + "/testdata.mat")
    # # print(X)
    # torch_X = torch.tensor(X["data2save_temp"], dtype=torch.float32)
    # time_step, channel_num, batch = torch_X.shape
    # X = torch_X.view(batch, time_step, channel_num)

    # Y = scio.loadmat("./test_data/label.mat")
    # Y = Y["test_label"]
    # Y = torch.tensor(Y, dtype=torch.long)

    # torch.save(X, "./test_src_data_0628.pkl")
    # torch.save(Y, "./test_tgt_data_0628.pkl")

    # print(X.shape)
    # print(Y.shape)
    # print(X[0])
